package org.uw.src.logic;

public class belt {
	public static final int mass_limit = 16; 
	private entityItem[] content = new entityItem[8];
	
	public float getMass() {
		float mass = 0;
		for(int i=0; i<content.length; i++) {
			if(content[i] != null) {
				mass += content[i].getMass();
			}
		}
		return mass;
	}
	
	public int getFirstEmptyslot() {
		for(int i=0; i<content.length; i++) {
			if(content[i] == null) {
				return i;
			}
		}
		return -1;
	}
	
	public void setItem(int i, entityItem e) {
		content[i] = e;
	}
	
	public entityItem getItem(int i) {
		return content[i];
	}
	
	public entityItem put(int i, entityItem e) {
		if(content[i] != null) {
			content[i] = e;
			return null;
		} else {
			entityItem extr = content[i];
			content[i] = e;
			return extr;
		}
		
	}
	
	public int getSize() {
		return content.length;
	}
}
